package api

import request "gitee.com/changeden/volcengine-livesaas-request-go"

type ListQuestionnaireAnswerDataRequest struct {
	ActivityId      *int64 `json:"ActivityId"`
	QuestionnaireId *int64 `json:"QuestionnaireId"`
	PageNo          *int32 `json:"PageNo"`
	PageItemCount   *int32 `json:"PageItemCount"`
	Source          *int32 `json:"Source"`
}
type ListQuestionnaireAnswerDataResponse struct {
	TotalItemCount int64           `json:"TotalItemCount" gorm:"column:TotalItemCount"`
	Questionnaires []Questionnaire `json:"Questionnaires" gorm:"column:Questionnaires"`
	PageItemCount  int32           `json:"PageItemCount" gorm:"column:PageItemCount"`
	PageNo         int32           `json:"PageNo" gorm:"column:PageNo"`
	Questions      []Question      `json:"Questions" gorm:"column:Questions"`
}
type Questionnaire struct {
	SendTime        int64            `json:"SendTime" gorm:"column:SendTime"`
	QuestionAnswers []QuestionAnswer `json:"QuestionAnswers" gorm:"column:QuestionAnswers"`
}
type Question struct {
	QuestionID int64  `json:"QuestionId" gorm:"column:QuestionId"`
	Question   string `json:"Question" gorm:"column:Question"`
}
type QuestionAnswer struct {
	Answer     string `json:"Answer" gorm:"column:Answer"`
	QuestionID string `json:"QuestionId" gorm:"column:QuestionId"`
	Question   string `json:"Question" gorm:"column:Question"`
}

func (instance *Instance) ListQuestionnaireAnswerData(data *ListQuestionnaireAnswerDataRequest) (*ListQuestionnaireAnswerDataResponse, error) {
	d := request.Data{
		Action: "ListQuestionnaireAnswerDataAPI",
	}
	bindQuery(&d, *data)
	var res ListQuestionnaireAnswerDataResponse
	err := instance.get(&d, &res)
	return &res, err
}
